Skip to main content

XAxisComponent

XAxisComponent API

XAxisComponent.doActivate
XAxisComponent.doActivate(): void

This method is used to activate the chart and update the labels if there is a new data set or equivolume type. It subscribes to the chart type change, candles set subject, candles updated subject, and time zone change to generate new labels. It also subscribes to the x-axis scale change and canvas resize to recalculate the labels.

Returns
void
XAxisComponent.getDrawer
XAxisComponent.getDrawer(): XAxisTimeLabelsDrawer

Returns the xAxisDrawer object.

Returns
XAxisTimeLabelsDrawer
XAxisComponent.registerXAxisLabelsProvider
XAxisComponent.registerXAxisLabelsProvider(provider: XAxisLabelsProvider): void

You can add a custom labels provider for additional labels on XAxis (like for drawings)

Parameters
provider: XAxisLabelsProvider
Returns
void
XAxisComponent.setVisible
XAxisComponent.setVisible(isVisible: boolean): void

Controls visibility of the x-axis

Parameters
isVisible: boolean
Returns
void
XAxisComponent.setFormatsForLabelsConfig
XAxisComponent.setFormatsForLabelsConfig(newFormatsByWeightMap: Record<TimeFormatWithDuration, string>): void

Set new config for x labels formatting

Parameters
newFormatsByWeightMap: Record<TimeFormatWithDuration, string>
Returns
void
XAxisComponent.isVisible
XAxisComponent.isVisible(): boolean

If visible, when you can see the x-axis on the chart

Returns
boolean
;